/*
 * Copyright (c) 2014 Hai Bison
 *
 * See the file LICENSE at the root directory of this project for copying
 * permission.
 */

package haibison.simpleprovider.simplesettings;

import haibison.simpleprovider.SimpleContract;
import android.content.Context;
import android.content.SharedPreferences;

/**
 * Contract for Simple Settings provider.
 * <p/>
 * Since {@link SharedPreferences} doesn't support multiple processes, we make
 * this simple provider for that use.
 * 
 * @author Hai Bison
 *
 */
public class SimpleSettingsContract extends SimpleContract {

    /**
     * This is singleton class.
     */
    private SimpleSettingsContract() {
    }// SimpleSettingsContract()

    /**
     * The authority.
     */
    private static final String AUTHORITY = "simple-settings";

    /**
     * Gets authority.
     * 
     * @param context
     *            the context.
     * @return the authority.
     */
    public static String getAuthority(Context context) {
        return context.getPackageName() + "." + AUTHORITY;
    }// getAuthority()

    /**
     * The table name.
     */
    public static final String TABLE_NAME = "simple_settings";

    /**
     * The key.
     * <p/>
     * Type: String, required.
     */
    public static final String COLUMN_KEY = "key";

    /**
     * The value.
     * <p/>
     * Type: String, optional.
     */
    public static final String COLUMN_VALUE = "value";

}
